package middleware

import (
	"github.com/go-redis/redis"
)

var Rdb *redis.Client
func GetRedisPool(Addr string,Password string,db int) *redis.Client{
	log = DataLogger()
	Rdb = redis.NewClient(&redis.Options{
		Addr:     Addr,
		Password: Password, // no password set
		DB:       db,  // use default DB
		PoolSize: 15, //连接池
	})
	pong, err := Rdb.Ping().Result()
	if err != nil {
		log.Errorf(pong, err)
	}
	return Rdb
}

